define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, undefined, Frontend, Form, Template) {
    var validatoroptions = {
        invalid: function (form, errors) {
            $.each(errors, function (i, j) {
                Layer.msg(j);
            });
        }
    };
    var Controller = {
        index: function () {
            // 给上传按钮添加上传成功事件
            Form.api.bindevent($("#signup-form"),
				function(data, ret){
					window.location.href = data.url
					return false;
				},
				function(data, ret){
					Layer.msg(ret.msg)
					$('.submitBtn').removeClass('disabled')
					return false
				},
				function(){
					$('.submitBtn').addClass('disabled')
				}
			);
        },
    };
    return Controller;
});
